package com.example.ice.coursetable;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {

	private Button button; //��������ͷ��ť

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		initViews();
	}

	private void initViews() {
		button = (Button) findViewById(R.id.main_button);
		button.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				//startActivity(new Intent(getApplicationContext(), CameraActivity.class));

				// TODO Auto-generated method stub

				Intent intent=new Intent();

				//Intent可以在不同的应用程序的Activity发送数据

				intent.putExtra("testIntent", "Robin");

				intent.setClass(MainActivity.this, CameraActivity.class);//从哪里跳到哪里

				MainActivity.this.startActivity(intent);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
//		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
